package jisuan4h9t;

public class car {
    public static void main(String[] args) {
        int sum = 48;
        int lun = 172;
        for (int i = 1;i <= sum;i++){
            for (int j = 1;j <=sum;j++){
                if (i+j == sum && 2*i+4*j==lun){
                    System.out.println("汽车数量："+j+",摩托车数量："+i);
                }
            }
        }
    }
}
